package com.ysx.server.mapper;

import com.ysx.server.pojo.entity.MessageParent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface MessageParentMapper {
    @Insert("insert into second_hand_trading.message_parent(goodsId, goodsName, msgStatus,createName) values(#{goodsId}, #{goodsName}, #{msgStatus},#{createName})")
    void save(MessageParent messageParent);

    @Select("select * from second_hand_trading.message_parent where goodsId = #{arg0} and createName = #{arg1}")
    MessageParent getByIdAndUser(Long goodsId, String createName);
    @Select("select * from second_hand_trading.message_parent where id = #{parentId}")
    MessageParent getById(Long parentId);
    @Update("update second_hand_trading.message_parent set msgStatus = 0 where id = #{parentId}")
    void updateStatusOK(Long parentId);
    @Update("update second_hand_trading.message_parent set msgStatus = 1 where id = #{parentId}")
    void updateStatusNoOK(Long parentId);
}
